import { ExtractPropTypes, PropType } from "vue";

export const treeProps = {
	data: {
		type: Object as PropType<Array<ITreeNode>>,
		require: true
	}
} as const;

export type TreeProps = ExtractPropTypes<typeof treeProps>;

export interface ITreeNode {
	label: string;
	id?: string | number;
	children?: ITreeNode[];

	selected?: boolean;
	checked?: boolean;
	expanded?: boolean;

	disableSelect?: boolean;
	disableCheck?: boolean;
	disableToggle?: boolean;
}

export interface IInnerTreeNode extends ITreeNode {
	parentId?: string | number;
	level: number;
	isLeaf?: boolean;
}
